/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-10-11 11:27:07
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2022-10-16 09:10:00
 * @FilePath: \adminstration\src\Pages\Front\Common\Other\Modal.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { Modal } from 'antd'
import { useEffect } from 'react'
import { useRef } from 'react'
import { SmallTitleStone } from './SmallTitle'

const { TMap } = window

// 石料厂额外弹出层
export const StoneModal = ({ children, className, setFalse, title }) => {
    return (
        <Modal
            className={className}
            onCancel={setFalse}
            open={true}
            footer={null}
            destroyOnClose
            maskClosable={false}
            keyboard={false}
            width="80vw"
        >
            <SmallTitleStone className="StoneModal" title={title} flex={1} style={{ marginBottom: 20 }} type={1}>
                {children}
            </SmallTitleStone>
        </Modal>
    )
}

// 导航
export const Navigation = ({ header, setFalse, data }) => {
    const NavigationBox = useRef()

    useEffect(() => {
        new TMap.Map(NavigationBox.current, {
            center: new TMap.LatLng(45.801173, 126.525713),
            zoom: 10,
        })
    }, [])

    return (
        <Modal
            className="MoreModal"
            onCancel={setFalse}
            open={true}
            footer={null}
            destroyOnClose
            maskClosable={false}
            keyboard={false}
            width="80vw"
        >
            <div className="header">{header}</div>
            <div className="body Navigation" ref={NavigationBox}>
                导航
            </div>
        </Modal>
    )
}
